home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / filutil / bison110.zip / PATCHES.OS2 < prev    next >
Text File  |  1990-07-02  |  7KB  |  242 lines

  1. diff -cbBw orig/files.c ./files.c
  2. *** orig/files.c    Tue Jun 26 00:02:18 1990
  3. --- ./files.c    Sun Jul 01 23:35:18 1990
  4. ***************
  5. *** 183,196 ****
  6.     filename = getenv("BISON_SIMPLE");
  7.   #ifdef MSDOS
  8.     /* file doesn't exist in curent directory, try in INIT directory */
  9. !   cp = getenv("INIT");
  10.     if (filename == 0 && cp != 0)
  11.       {
  12. !       filename = malloc(strlen(cp) + strlen(PFILE) + 2);
  13. !       strcpy(filename, cp);
  14. !       cp = filename + strlen(filename);
  15. !       *cp++ = '/';
  16. !       strcpy(cp, PFILE);
  17.       }
  18.   #endif /* MSDOS */
  19.     fparser = tryopen(filename ? filename : PFILE, "r");
  20. --- 183,195 ----
  21.     filename = getenv("BISON_SIMPLE");
  22.   #ifdef MSDOS
  23.     /* file doesn't exist in curent directory, try in INIT directory */
  24. !   cp = getenv("PATH");
  25.     if (filename == 0 && cp != 0)
  26.       {
  27. !       filename = malloc(255);
  28. !       _searchenv(PFILE, "PATH", filename);
  29. !       if ( filename[0] == 0 )
  30. !         strcpy(filename,PFILE);
  31.       }
  32.   #endif /* MSDOS */
  33.     fparser = tryopen(filename ? filename : PFILE, "r");
  34. ***************
  35. *** 271,284 ****
  36.     filename = (char *) getenv ("BISON_HAIRY");
  37.   #ifdef MSDOS
  38.     /* file doesn't exist in curent directory, try in INIT directory */
  39. !   cp = getenv("INIT");
  40.     if (filename == 0 && cp != 0)
  41.       {
  42. !       filename = malloc(strlen(cp) + strlen(PFILE1) + 2);
  43. !       strcpy(filename, cp);
  44. !       cp = filename + strlen(filename);
  45. !       *cp++ = '/';
  46. !       strcpy(cp, PFILE1);
  47.       }
  48.   #endif
  49.     fparser= tryopen(filename ? filename : PFILE1, "r");
  50. --- 270,282 ----
  51.     filename = (char *) getenv ("BISON_HAIRY");
  52.   #ifdef MSDOS
  53.     /* file doesn't exist in curent directory, try in INIT directory */
  54. !   cp = getenv("PATH");
  55.     if (filename == 0 && cp != 0)
  56.       {
  57. !        filename = malloc(255);
  58. !        _searchenv(PFILE1, "PATH", filename);
  59. !        if ( filename[0] == 0 )
  60. !          strcpy(filename,PFILE1);
  61.       }
  62.   #endif
  63.     fparser= tryopen(filename ? filename : PFILE1, "r");
  64. ***************
  65. *** 303,308 ****
  66. --- 301,319 ----
  67.   char *mode;
  68.   {
  69.     FILE    *ptr;
  70. + #ifdef MSDOS
  71. +   char drive[3], path[128], fname[16], ext[16];
  72. +   _splitpath(name, drive, path, fname, ext);
  73. +   if ( strlen(fname) > 8 )
  74. +     fname[8] = 0;
  75. +   if ( strlen(ext) > 4 )
  76. +     ext[4] = 0;
  77. +   _makepath(name, drive, path, fname, ext);
  78. + #endif
  79.   
  80.     ptr = fopen(name, mode);
  81.     if (ptr == NULL)
  82. diff -cbBw orig/files.h ./files.h
  83. *** orig/files.h    Tue Jun 26 00:02:18 1990
  84. --- ./files.h    Sun Jul 01 23:26:24 1990
  85. ***************
  86. *** 40,45 ****
  87. --- 40,46 ----
  88.   
  89.   /* File name pfx specified with -b, or 0 if no -b.  */
  90.   extern char *spec_file_prefix;
  91. + extern char *spec_name_prefix;
  92.   
  93.   extern char *infile;
  94.   extern char *outfile;
  95. diff -cbBw orig/getargs.c ./getargs.c
  96. *** orig/getargs.c    Tue Jun 26 00:02:18 1990
  97. --- ./getargs.c    Sun Jul 01 23:27:46 1990
  98. ***************
  99. *** 27,33 ****
  100. --- 27,35 ----
  101.   int debugflag;
  102.   int nolinesflag;
  103.   char *spec_name_prefix; /* For -a.  */
  104. + char *spec_file_prefix; /* -b */
  105.   extern int fixed_outfiles;/* JF */
  106. + extern char *version_string;
  107.   
  108.   extern int getopt();
  109.   extern void fatal();
  110. ***************
  111. *** 65,70 ****
  112. --- 67,75 ----
  113.       fixed_outfiles = 1;
  114.   #endif
  115.   
  116. +   if ( argc == 1 )
  117. +     usage(argv[0]);
  118.     while ((c = getopt (argc, argv, "yvdlto:b:a:")) != EOF)
  119.       switch (c)
  120.         {
  121. ***************
  122. *** 74,82 ****
  123.   
  124.         case 'v':
  125.           if(optind && argv[optind] && !strcmp(argv[optind],"-version")) {
  126. -       extern char *version_string;
  127.   
  128. !       printf("%s",version_string);
  129.         while(getopt(argc,argv,"ersion")!='n')
  130.          ;
  131.       } else
  132. --- 79,86 ----
  133.   
  134.         case 'v':
  135.           if(optind && argv[optind] && !strcmp(argv[optind],"-version")) {
  136.   
  137. !           printf("\n%s",version_string);
  138.         while(getopt(argc,argv,"ersion")!='n')
  139.          ;
  140.       } else
  141. ***************
  142. *** 115,118 ****
  143. --- 119,154 ----
  144.   
  145.     if (optind < argc - 1)
  146.       fprintf(stderr, "bison: warning: extra arguments ignored\n");
  147. + }
  148. + usage(name)
  149. + char *name;
  150. + {
  151. +   printf("\n%s", version_string);
  152. +   printf("\nUsage: %s [-dltvy] [-o file] file\n", name);
  153. +   printf("\n  -d       Produce a .tab.h file, similar to yacc's y.tab.h file."
  154. +          "\n  -l       Omit #line lines in the parser output file. Error mes-"
  155. +          "\n           sages from the C compiler will then be associated with"
  156. +          "\n           lines in the parser output file, instead of lines in"
  157. +          "\n           the original grammar file.");
  158. +   printf("\n  -t       Turn on debugging. This option causes the bison output"
  159. +          "\n           to have debugging code made available via the C pre-"
  160. +          "\n           processor.  The external variable yydebug should be"
  161. +          "\n           made non-zero to have the debugging code actually pro-"
  162. +          "\n           duce output.");
  163. +   printf("\n  -v       Be verbose. Analogous to the same flag for yacc."
  164. +          "\n  -y       Use fixed output file names. I.e., force the output to"
  165. +          "\n           be in files y.tab.c, y.tab.h, and so on. This is for"
  166. +          "\n           full yacc compatibility."
  167. +          "\n  -o file  Define special output file name.\n");
  168. +   exit(1);
  169.   }
  170. diff -cbBw orig/lex.c ./lex.c
  171. *** orig/lex.c    Tue Jun 26 00:02:18 1990
  172. --- ./lex.c    Sun Jul 01 23:16:34 1990
  173. ***************
  174. *** 220,226 ****
  175.           else if (c == 'n')
  176.             code = '\n';
  177.           else if (c == 'a')
  178. !           code = '007';
  179.           else if (c == 'r')
  180.             code = '\r';
  181.           else if (c == 'f')
  182. --- 220,226 ----
  183.           else if (c == 'n')
  184.             code = '\n';
  185.           else if (c == 'a')
  186. !                   code = 007;
  187.           else if (c == 'r')
  188.             code = '\r';
  189.           else if (c == 'f')
  190. diff -cbBw orig/main.c ./main.c
  191. *** orig/main.c    Tue Jun 26 00:02:20 1990
  192. --- ./main.c    Sun Jul 01 23:08:42 1990
  193. ***************
  194. *** 90,98 ****
  195.     extern char *infile;
  196.   
  197.     if (infile == 0)
  198. !     fprintf(stderr, "fatal error: %s\n", s);
  199.     else
  200. !     fprintf(stderr, "\"%s\", line %d: %s\n", infile, lineno, s);
  201.     done(1);
  202.   }
  203.   
  204. --- 90,98 ----
  205.     extern char *infile;
  206.   
  207.     if (infile == 0)
  208. !     fprintf(stderr, "\nfatal error: %s\n", s);
  209.     else
  210. !     fprintf(stderr, "\n\"%s\", line %d: %s\n", infile, lineno, s);
  211.     done(1);
  212.   }
  213.   
  214. diff -cbBw orig/reader.c ./reader.c
  215. *** orig/reader.c    Tue Jun 26 00:02:20 1990
  216. --- ./reader.c    Sun Jul 01 23:14:50 1990
  217. ***************
  218. *** 33,38 ****
  219. --- 33,39 ----
  220.   #include "symtab.h"
  221.   #include "lex.h"
  222.   #include "gram.h"
  223. + #include "machine.h"
  224.   
  225.   
  226.   #define    LTYPESTR    "\n#ifndef YYLTYPE\ntypedef\n  struct yyltype\n\
  227.